# -*- coding: utf-8 -*-
#
# File: ProposicionNews.py
#
# Copyright (c) 2008 by Menttes SRL
# Generator: ArchGenXML Version 2.1
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """Roberto Allende <rover@menttes.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.ATContentTypes.content.newsitem import ATNewsItem
from Products.ATContentTypes.content.newsitem import ATNewsItemSchema
from Products.ProposicionCT.config import *

# additional imports from tagged value 'import'
from Products.ATCountryWidget.Widget import CountryWidget, AreaWidget, MultiCountryWidget ; from Products.DataGridField import DataGridField, DataGridWidget ; from Products.DataGridField.Column import Column

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    DateTimeField(
        name='date',
        widget=DateTimeField._properties['widget'](
            label='Date',
            label_msgid='ProposicionCT_label_date',
            i18n_domain='ProposicionCT',
        ),
        required=True,
    ),
    StringField(
        name='country',
        widget=CountryWidget(
            label='Country',
            label_msgid='ProposicionCT_label_country',
            i18n_domain='ProposicionCT',
        ),
        required=True,
    ),
    StringField(
        name='author',
        widget=StringField._properties['widget'](
            label='Author',
            label_msgid='ProposicionCT_label_author',
            i18n_domain='ProposicionCT',
        ),
    ),
    DataGridField(
        name='source',
        widget=DataGridWidget(
            label='Source',
            label_msgid='ProposicionCT_label_source',
            i18n_domain='ProposicionCT',
        ),
        columns={'Url' : Column("Url"),'Site Name' : Column("Site"),},
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

ProposicionNews_schema = ATNewsItemSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here

ProposicionNews_schema['source'].default=[{'Url':'http://','Site Name':''}]
ProposicionNews_schema['image'].widget.visible = {'edit': 'hidden', 'view': 'invisible'}
ProposicionNews_schema['imageCaption'].widget.visible = {'edit': 'hidden', 'view': 'invisible'}

##/code-section after-schema

class ProposicionNews(ATNewsItem):
    """
    """
    security = ClassSecurityInfo()

    implements(interfaces.IProposicionNews)

    meta_type = 'ProposicionNews'
    _at_rename_after_creation = True

    schema = ProposicionNews_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(ProposicionNews, PROJECTNAME)
# end of class ProposicionNews

##code-section module-footer #fill in your manual code here
##/code-section module-footer



